<!DOCTYPE html>
<html>
<head>
    <title>查看--中软高科-2015</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>
    <script type="text/javascript" src="../Js/ckeditor/ckeditor.js"></script>
 

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
    <script type="text/javascript">
    $(function () {       
		$('#backid').click(function(){
				window.location.href="index.html";
		 });
    });
    </script>
</head>
<body>
<form action="index.html" method="post" class="definewidth m20">
<table class="table table-bordered table-hover definewidth m10">
    <tr>
        <td width="10%" class="tableleft">姓名</td>
        <td><div id="doctorName"></div></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">证件类型</td>
        <td>身份证</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">证件号</td>
        <td><div id="idNumber"></div></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">手机</td>
        <td><div id="phone"></div></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">座机</td>
        <td><div id="telPhone"></div></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">性别</td>
        <td><div id="sex"></div></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">年龄</td>
        <td><div id="age"></div></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">出生年月</td>
        <td><div id="birthday"></div></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">电子邮箱</td>
        <td><div id="email"></div></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">所属科室</td>
        <td><div id="deptName"></div></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">学历</td>
        <td><div id="eduction"></div></td>
    </tr>
	<tr>
        <td width="10%" class="tableleft">备注</td>
        <td><div id="description"></div></td>
	</tr>
    <tr>
        <td colspan="2">
			<center>
				<button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
			</center>
		</td>
    </tr>
</table>
</form>
</body>
<script>
    function oneValues(){
        var result;
        var url=window.location.search; //获取url中"?"符后的字串
        if(url.indexOf("?")!=-1){
            result = url.substr(url.indexOf("=")+1);
        }
        return result;
    }
    loadFunction()
    function loadFunction() {
        $.ajax({
            type: "GET",
            url: "/Doctor/findDoctorById",
            data: {"id":oneValues()},
            dataType:"json",
            success: function(vo) {
                console.log(vo);
                let data = vo.obj;
                document.getElementById('doctorName').innerHTML=data.doctorName;
                document.getElementById('idNumber').innerHTML=data.idNumber;
                document.getElementById('phone').innerHTML=data.phone;
                document.getElementById('telPhone').innerHTML=data.telPhone;
                data.sex==1?document.getElementById('sex').innerHTML="男":document.getElementById('sex').innerHTML="女";
                document.getElementById('age').innerHTML=data.age;
                document.getElementById('birthday').innerHTML=data.birthday;
                data.dept==null?document.getElementById('deptName').innerHTML='未分配科室': document.getElementById('deptName').innerHTML=data.dept.deptName;
                document.getElementById('email').innerHTML=data.email;
                data.eduction==0?(document.getElementById('eduction').innerHTML='没查询到学历'):(document.getElementById('eduction').innerHTML=data.eduction);
                document.getElementById('description').innerHTML=data.description;


            }
        });
    }
</script>
</html>